core: Drop ot_gfile_new_for_path
authorColin Walters <walters@verbum.org>
Sat, 30 Jun 2012 17:42:22 +0000 (13:42 -0400)
committerColin Walters <walters@verbum.org>
Sat, 30 Jun 2012 17:42:24 +0000 (13:42 -0400)
Not necessary anymore since we switched to GIO_USE_VFS=local in the
binaries.

12 files changed:
src/daemon/ot-daemon.c
src/libostree/ostree-repo.c
src/libostree/ostree-sysroot.c
src/libotutil/ot-gio-utils.c
src/libotutil/ot-gio-utils.h
src/ostree/ot-builtin-checkout.c
src/ostree/ot-builtin-checksum.c
src/ostree/ot-builtin-commit.c
src/ostree/ot-builtin-diff.c
src/ostree/ot-builtin-pull-local.c
src/ostree/ot-builtin-show.c
src/ostree/ot-main.c

index 7ef1b1791b29a73889d34a478c17c9d96692e48f..28c7906ebeea6e683555834d955c6d6f7a7dc206 100644 (file)
@@ -153,7 +153,7 @@ overlay_dir_thread (gpointer data)
 
   context = g_main_context_new ();
 
-  sysroot_f = ot_gfile_new_for_path ("/sysroot/ostree/current");
+  sysroot_f = g_file_new_for_path ("/sysroot/ostree/current");
 
   g_main_context_push_thread_default (context);
 
@@ -181,7 +181,7 @@ do_op_overlay (OstreeDaemon            *self,
   OverlayDirThreadData *tdata = g_new0 (OverlayDirThreadData, 1);
   
   tdata->op = op;
-  tdata->dir = ot_gfile_new_for_path (dir);
+  tdata->dir = g_file_new_for_path (dir);
 
 #if GLIB_CHECK_VERSION(2,32,0) && !defined(OSTREE_GLIB_TARGET_MIN)
   g_thread_new ("overlay-dir-thread", overlay_dir_thread, tdata);
@@ -316,9 +316,9 @@ ostree_daemon_config (OstreeDaemon *self,
     }
 
   if (is_dummy)
-    self->prefix = ot_gfile_new_for_path (config->dummy_test_path);
+    self->prefix = g_file_new_for_path (config->dummy_test_path);
   else
-    self->prefix = ot_gfile_new_for_path ("/sysroot/ostree");
+    self->prefix = g_file_new_for_path ("/sysroot/ostree");
       
   self->name_id = g_bus_own_name (is_dummy ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
                                   OSTREE_DAEMON_NAME,
index 6fee20a7c6000fe1fb1164974e1cca1d2a3514de..c62614e1589ba9ef953fee6387749f22820622d9 100644 (file)
@@ -137,7 +137,7 @@ ostree_repo_set_property(GObject         *object,
     {
     case PROP_PATH:
       /* Canonicalize */
-      self->repodir = ot_gfile_new_for_path (ot_gfile_get_path_cached (g_value_get_object (value)));
+      self->repodir = g_file_new_for_path (ot_gfile_get_path_cached (g_value_get_object (value)));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -724,7 +724,7 @@ ostree_repo_check (OstreeRepo *self, GError **error)
 
   if (parent_repo_path && parent_repo_path[0])
     {
-      ot_lobj GFile *parent_repo_f = ot_gfile_new_for_path (parent_repo_path);
+      ot_lobj GFile *parent_repo_f = g_file_new_for_path (parent_repo_path);
 
       self->parent_repo = ostree_repo_new (parent_repo_f);
 
index 43b513bc08800373e829d94c47bd3f12afd34c0d..cd1d686187af718ff3bcf6f4ba63fafb984bfcf3 100644 (file)
@@ -68,7 +68,7 @@ ostree_run_triggers_in_root (GFile                  *root,
   if (root)
     triggerdir = g_file_resolve_relative_path (root, rel_triggerdir);
   else
-    triggerdir = ot_gfile_new_for_path (rel_triggerdir);
+    triggerdir = g_file_new_for_path (rel_triggerdir);
 
   if (g_file_query_exists (triggerdir, cancellable))
     {
index b27507dcb329667b38c7ddac59aa1c7435870170..86b7c946653a800c6614691542a926ceae1f2754 100644 (file)
@@ -220,13 +220,6 @@ ot_gfile_load_contents_utf8 (GFile         *file,
   return ret;
 }
 
-/* Like g_file_new_for_path, but only do local stuff, not GVFS */
-GFile *
-ot_gfile_new_for_path (const char *path)
-{
-  return g_vfs_get_file_for_path (g_vfs_get_local (), path);
-}
-
 const char *
 ot_gfile_get_path_cached (GFile *file)
 {
index 9299a44b623f7fd4ef875a7bc804f82007f67b1c..65d3c88216e9b31145d0cb1e76bd401dc219a59a 100644 (file)
@@ -40,8 +40,6 @@ GFile *ot_gfile_from_build_path (const char *first, ...) G_GNUC_NULL_TERMINATED;
 
 GFile *ot_gfile_get_child_strconcat (GFile *parent, const char *first, ...) G_GNUC_NULL_TERMINATED;
 
-GFile *ot_gfile_new_for_path (const char *path);
-
 const char *ot_gfile_get_path_cached (GFile *file);
 
 const char *ot_gfile_get_basename_cached (GFile *file);
index ab6eb8038fd3f0fd8428a13f7a58fb0e93ad48c3..12a8f392ffce13299ee736995c66d597be42948e 100644 (file)
@@ -229,7 +229,7 @@ process_many_checkouts (OstreeRepo         *repo,
     }
   else
     {
-      ot_lobj GFile *f = ot_gfile_new_for_path (opt_from_file);
+      ot_lobj GFile *f = g_file_new_for_path (opt_from_file);
 
       instream = (GInputStream*)g_file_read (f, cancellable, error);
       if (!instream)
@@ -327,7 +327,7 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
         }
 
       destination = argv[1];
-      checkout_target = ot_gfile_new_for_path (destination);
+      checkout_target = g_file_new_for_path (destination);
 
       if (!process_many_checkouts (repo, checkout_target, cancellable, error))
         goto out;
@@ -354,10 +354,10 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
           GError *temp_error = NULL;
 
           suffixed_destination = g_strconcat (destination, "-", resolved_commit, NULL);
-          checkout_target = ot_gfile_new_for_path (suffixed_destination);
+          checkout_target = g_file_new_for_path (suffixed_destination);
           tmp_destination = g_strconcat (suffixed_destination, ".tmp", NULL);
-          checkout_target_tmp = ot_gfile_new_for_path (tmp_destination);
-          symlink_target = ot_gfile_new_for_path (destination);
+          checkout_target_tmp = g_file_new_for_path (tmp_destination);
+          symlink_target = g_file_new_for_path (destination);
 
           if (!parse_commit_from_symlink (symlink_target, &existing_commit,
                                           cancellable, &temp_error))
@@ -380,7 +380,7 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
         }
       else
         {
-          checkout_target = ot_gfile_new_for_path (destination);
+          checkout_target = g_file_new_for_path (destination);
           skip_checkout = FALSE;
         }
 
index 3ef35797906e9ca33e82c86e853641dd6084028a..64f35cade8f3b14571076f8d33b76142b14906b1 100644 (file)
@@ -69,7 +69,7 @@ ostree_builtin_checksum (int argc, char **argv, GFile *repo_path_path, GError **
     goto out;
 
   if (argc > 1)
-    f = ot_gfile_new_for_path (argv[1]);
+    f = g_file_new_for_path (argv[1]);
   else
     {
       g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
index a00c6027066c07220ce3986747999e32f76be5bf..730e32183256dd1baf44086aa8a736018135c0da 100644 (file)
@@ -77,7 +77,7 @@ parse_statoverride_file (GHashTable   **out_mode_add,
   ot_lfree char *contents = NULL;
   char **lines = NULL;
 
-  path = ot_gfile_new_for_path (statoverride_file);
+  path = g_file_new_for_path (statoverride_file);
 
   if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
                              error))
@@ -136,7 +136,7 @@ parse_related_objects_file (GVariant     **out_related_objects,
   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(say)"));
   builder_initialized = TRUE;
 
-  path = ot_gfile_new_for_path (opt_related_objects_file);
+  path = g_file_new_for_path (opt_related_objects_file);
 
   if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
                              error))
@@ -262,7 +262,7 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
         }
       else if (metadata_bin_path)
         {
-          metadata_f = ot_gfile_new_for_path (metadata_bin_path);
+          metadata_f = g_file_new_for_path (metadata_bin_path);
           if (!ot_util_variant_map (metadata_f, G_VARIANT_TYPE ("a{sv}"), TRUE,
                                     &metadata, error))
             goto out;
@@ -361,7 +361,7 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
   if (argc == 1 && (trees == NULL || trees[0] == NULL))
     {
       char *current_dir = g_get_current_dir ();
-      arg = ot_gfile_new_for_path (current_dir);
+      arg = g_file_new_for_path (current_dir);
       g_free (current_dir);
 
       if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
@@ -392,14 +392,14 @@ ostree_builtin_commit (int argc, char **argv, GFile *repo_path, GError **error)
           g_clear_object (&arg);
           if (strcmp (tree_type, "dir") == 0)
             {
-              arg = ot_gfile_new_for_path (tree);
+              arg = g_file_new_for_path (tree);
               if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
                                                          cancellable, error))
                 goto out;
             }
           else if (strcmp (tree_type, "tar") == 0)
             {
-              arg = ot_gfile_new_for_path (tree);
+              arg = g_file_new_for_path (tree);
               if (!ostree_repo_stage_archive_to_mtree (repo, arg, mtree, modifier,
                                                        tar_autocreate_parents,
                                                        cancellable, error))
index 335096a723d57e5e3409755bb60b9b90bc718df6..b18efe71a8b8417026fe813ea69350ad2f321eee 100644 (file)
@@ -45,7 +45,7 @@ parse_file_or_commit (OstreeRepo  *repo,
       || g_str_has_prefix (arg, "./")
       )
     {
-      ret_file = ot_gfile_new_for_path (arg);
+      ret_file = g_file_new_for_path (arg);
     }
   else
     {
@@ -461,7 +461,7 @@ ostree_builtin_diff (int argc, char **argv, GFile *repo_path, GError **error)
       target = argv[2];
     }
 
-  cwd = ot_gfile_new_for_path (".");
+  cwd = g_file_new_for_path (".");
 
   if (!parse_file_or_commit (repo, src, &srcf, cancellable, error))
     goto out;
index 5650b3088a4eb535821792fee9ba9daed9cbda7d..2dec76270cb89c54fd77cee86fab5763ebf1a2e4 100644 (file)
@@ -135,7 +135,7 @@ ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GError **err
     }
 
   src_repo_path = argv[1];
-  src_f = ot_gfile_new_for_path (src_repo_path);
+  src_f = g_file_new_for_path (src_repo_path);
 
   data.src_repo = ostree_repo_new (src_f);
   if (!ostree_repo_check (data.src_repo, error))
index 8edc4c72de7f6b96828309a5d82750586bda7f44..72b88784411d31c100d67a531da11c988d045c4b 100644 (file)
@@ -65,7 +65,7 @@ do_print_variant_generic (const GVariantType *type,
   ot_lobj GFile *f = NULL;
   ot_lvariant GVariant *variant = NULL;
 
-  f = ot_gfile_new_for_path (filename);
+  f = g_file_new_for_path (filename);
 
   if (!ot_util_variant_map (f, type, TRUE, &variant, error))
     goto out;
index d9e26010d60c8a436345f54670f07078a1885106..85f39ab0c3d1992fe7d56ffc4edda63604a23ca2 100644 (file)
@@ -118,7 +118,7 @@ ostree_main (int    argc,
     repo = NULL;
 
   if (repo)
-    repo_file = ot_gfile_new_for_path (repo);
+    repo_file = g_file_new_for_path (repo);
 
   slash = strrchr (argv[0], '/');
   if (slash)